const express = require("express");
// 引入连接池模块
const pool = require("../pool.js");
// 创建路由器对象
const r = express.Router();

// 查找类别表
r.get("/search",(req,res)=>{
  var obj = req.params;
  var sql = "select * from regional_classification";
  pool.query(sql,[obj],(err,result)=>{
		if(err) throw err;
		if(result.length>0){
			res.send(result)
		}else{
			res.send("0")
    }
  })
});



// 导出连接池对象
module.exports = r;